﻿using WindowsForms.AOnline.View.Dictionary;
//using System.Threading.Tasks;

namespace WindowsForms.AOnline.Presenter.Dictionary.Customer
{
    public class CustomersPresenter : Presenter<ICustomersView> 
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CurrenciesPresenter" /> class.
        /// </summary>
        /// <param name="view">The view.</param>
        public CustomersPresenter(ICustomersView view) 
            : base(view)
        {
        }

        /// <summary>
        /// Displays this instance.
        /// </summary>
        public void Display(int page)
        {
            View.Customers = Model.GetCustomers(page);
        }

        /// <summary>
        /// Gets the size of the page.
        /// </summary>
        /// <returns></returns>
        public int GetPageSize()
        {
            return Model.GetPageSizeCustomers();
        }

        /// <summary>
        /// Displays the active.
        /// </summary>
        /// <param name="isActive">if set to <c>true</c> [is active].</param>
        public void DisplayActive(bool isActive)
        {
            View.Customers = Model.GetCustomersByActive(isActive);
        }

        /// <summary>
        /// Displays this instance.
        /// </summary>
        public void GetAll()
        {
            View.Customers = Model.GetAllCustomers();
        }

    }
}
